package cn.itsource.org.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data //会在编译的时候自动生成getter，setter等方法
@AllArgsConstructor//注在类上，提供类的全参构造
@NoArgsConstructor//注在类上，提供类的无参构造
public class Department {
    //部门ID
    private Long id;
    //部门编号
    private String sn;
    //部门名字
    private String name;
    //部门路径
    private String dirPath;
    //部门状态
    private Integer state;
    //部门经理的ID
    private Long manager_id;
    //上级部门ID
    private Long parent_id;
    //管理员对象
    private Employee manager;
    //上级部门对象
    private Department parent;
    //子部门集合
    //部门树最后一级没有数据就不显示
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Department> children = new ArrayList<Department>();;
}
